<template>
  <div class="page myDetail">
    <div class="scroll-view">
      <customHeader middleTitle="个人信息" />
      <div class="page-body">
        <ul class="form-style">
          <li>
            <span class="required">姓名</span>
            <div>{{data.name}}</div>
          </li>
          <li>
            <span class="required">员工编号</span>
            <div>{{data.code?data.code : '无'}}</div>
          </li>
          <li>
            <span class="required">规制编制</span>
            <div>{{data.affiliationName}}</div>
          </li>
          <li>
            <span class="required">员工角色</span>
            <div>{{data.roleName}}</div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import customHeader from "../../components/header/header";
import { Toast } from "mint-ui";
import jsBridge from "../../tools/jsBridge.js";
export default {
  name: "myDetail",
  data() {
    return {
      data:''
    };
  },
  methods: {
    getMYDetail() {
      this.ajax({
        url: "/newapp/employee/info.do",
        type: "get",
        controlLoading: true
      })
        .then(res => {
          if (res.success) {
            if (res.resultObject) {
              this.data=res.resultObject;
            } else {
              Toast(res.msg);
            }
          } else {
            Toast(res.msg);
          }
        })
        .catch(err => {
          Toast(err.msg);
        });
    }
  },
  components: {
    customHeader
  },
  mounted() {
    let param = this.$route.query;
    if(param.roleName){
      this.data=param;
    }else{
      this.getMYDetail();
    }

  }
};
</script>
<style lang='scss' scoped>
@import "myDetail";
</style>
